import Vue from 'vue';
import * as Fiber from 'fiber';

Vue.use(Fiber, { icon: [] });

const appStyle = `
* {margin: 0; padding: 0}
ul,li { list-style: none}
body { margin: 20px}
ul { margin-left: 1em; font-size: 18px}
.app { text-align: center}
`;

const App = {
  name: 'ServeIndex',
  render() {
    const list = window.SERVE_PROJECTS || [];
    return (
      <div class="app">
        <h2>待调试工程</h2>
        <style>{appStyle}</style>
        <ul style="font-size: 16px">
          {list.map((project) => (
            <li>
              <a href={`${project}.html`}>{project}</a>
            </li>
          ))}
        </ul>
      </div>
    );
  }
};

new Vue({
  render: (h) => {
    return h('a-config-provider', { props: { locale: window._locale, global: window } }, [h(App)]);
  }
}).$mount('#app');
